import {ElMessage, ElMessageBox} from 'element-plus'

//消息提示
export const Message = {
    success: (message: string) => {
        ElMessage({
            message: message,
            type: 'success',
        })
    },
    error: (message: string) => {
        ElMessage({
            message: message,
            type: 'error',
        })
    },
    warning: (message: string) => {
        ElMessage({
            message: message,
            type: 'warning',
        })
    },
    info: (message: string) => {
        ElMessage({
            message: message,
            type: 'info',
        })
    },
}

//消息弹出框
export const MessageBox = {
    confirm: (message: string) => {
        return ElMessageBox.confirm(message, '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning',
        })
    },
}